#define _CRT_SECURE_NO_WARNINGS 1
#include"list.h"
#include<vector>
#include<cstring>
using namespace std;

void test_list1()
{
	bitmq::List<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);

	bitmq::List<int>::iterator it = lt.begin();
	while (it != lt.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto e : lt)
	{
		cout << e << " ";
	}
	cout << endl;
}
void test_list2()
{
	bitmq::List<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);

	bitmq::List<int> lt1(lt);

	for (auto e : lt)
	{
		cout << e << " ";
	}
	cout << endl;

	for (auto e : lt1)
	{
		cout << e << " ";
	}
	cout << endl;

	bitmq::List<int> lt2;
	lt2.push_back(10);
	lt2.push_back(200);
	lt2.push_back(30);
	lt2.push_back(40);
	lt2.push_back(50);

	lt1 = lt2;
	for (auto e : lt1)
	{
		cout << e << " ";
	}
	cout << endl;

	for (auto e : lt2)
	{
		cout << e << " ";
	}
	cout << endl;
}
struct AA
{
	AA(int a1 = 0, int a2 = 0)
		:_a1(a1)
		, _a2(a2)
	{}

	int _a1;
	int _a2;
};

void test_list3()
{
	bitmq::List<AA> lt;
	lt.push_back(AA(1, 1));
	lt.push_back(AA(2, 2));
	lt.push_back(AA(3, 3));

	bitmq::List<AA>::iterator it = lt.begin();
	while (it != lt.end())
	{
		//cout << (*it)._a1<<" "<<(*it)._a2 << endl;
		cout << it->_a1 << " " << it->_a2 << endl;
		cout << it.operator->()->_a1 << " " << it->_a1 << endl;


		++it;
	}
	cout << endl;

	int* p = new int;
	*p = 1;

	AA* ptr = new AA;
	ptr->_a1 = 1;

}
template<typename Container>
void print_container(const Container& con)
{
	typename Container::const_iterator it = con.begin();
	while (it != con.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
}

void test_list4()
{
	bitmq::List<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_back(5);
	//print_list(lt);
	print_container(lt);

	bitmq::List<string> lt1;
	lt1.push_back("1111111111111");
	lt1.push_back("1111111111111");
	lt1.push_back("1111111111111");
	lt1.push_back("1111111111111");
	lt1.push_back("1111111111111");
	//print_list(lt1);
	print_container(lt1);

	vector<string> v;
	v.push_back("222222222222222222222");
	v.push_back("222222222222222222222");
	v.push_back("222222222222222222222");
	v.push_back("222222222222222222222");
	//print_list(v);
	print_container(v);
}

int main() {
	test_list4();
	return 0;
}